<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>添加病人体征记录</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layui/css/layui.css"  media="all">
    <style>
        .form{
            margin-left: 35%;
            margin-top: 15px;
        }
        .div{
            margin-left: 20%;
            margin-top: 10px;
        }
        .div1{
            margin-left: 120px;
        }
    </style>
</head>
<body>
<form class="layui-form form" action="/patientSignCom" method="get">
    <div class="layui-form-item">
        <label class="layui-form-label">身份证号：</label>
        <div class="layui-input-inline">
            <input type="text" name="idNumber" id="patientIdNumber" required="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</label>
        <div class="layui-input-inline">
            <input type="text" name="name" id="patientName" lay-verify="name" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">医生姓名：</label>
        <div class="layui-input-inline">
            <input type="text" name="doctorName" id="doctorName" lay-verify="name" autocomplete="off" class="layui-input">
        </div>
    </div>
    <input type="hidden" name="doctorId" id="doctorId">
    <div class="layui-form-item">
        <label class="layui-form-label">体&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;温：</label>
        <div class="layui-input-inline">
            <input type="text" name="temperature" lay-verify="temperature" lay-reqtext="体温值不能为空" placeholder="请输入体温值：如36.5" autocomplete="on" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">心&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;率：</label>
        <div class="layui-input-inline">
            <input type="text" name="heartRate" lay-verify="heartRate" lay-reqtext="心率值不能为空" placeholder="请输入心率值：如 75" autocomplete="on" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">血&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;压：</label>
        <div class="layui-input-inline">
            <input type="text" name="bloodPressure" lay-verify="bloodPressure" lay-reqtext="血压值不能为空" placeholder="请输入：如90/139mmHg" autocomplete="on" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">血&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;糖：</label>
        <div class="layui-input-inline">
            <input type="text" name="bloodSugar" lay-verify="bloodSugar" lay-reqtext="血糖值不能为空" placeholder="请输入血糖值：如 4.5" autocomplete="on" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</label>
        <div class="layui-input-inline">
            <input type="text" name="remarks" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <!--<button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>-->
            <input type="submit" class="layui-btn" value="立即提交">
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

<!--这里是弹出层的表单信息-->
<!--表单的id用于表单的选择，style是在本页隐藏，只有点击编辑才会弹出-->
<div class="layui-row" id="selectInputPatient" style="display:none;">
    <form method="get" action="">
    <div class="layui-form demoTable div">

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">住&nbsp;&nbsp;院&nbsp;&nbsp;号：</label>
                <div class="layui-input-inline">
                    <input type="text" name="id" id="id" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">科&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;室：</label>
                <div class="layui-input-inline">
                    <select name="departId" id="departId"></select>
                    <input type="hidden" id="selectId" value="${a.a_type}">
                </div>
            </div><br><br>
            <div class="layui-inline">
                <label class="layui-form-label">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" id="name1" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">身份证号：</label>
                <div class="layui-input-inline">
                    <input type="text" name="idNumber" id="idNumber1" autocomplete="off" class="layui-input">
                </div>
            </div><br>
        </div>
        <div class="layui-form-item div1">
            <div class="layui-input-block">
                <!--<button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1" data-type="reload">搜索</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
                <input type="submit" value="搜索">
                <button type="reset" class="layui-btn layui-btn-primary">清空条件</button>
            </div>
        </div>

    </div>
    </form>

    <table class="layui-hide" id="doctor" lay-filter="user"></table>
</div>

<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
</script>

<script src="../layui/layui.js" charset="utf-8"></script>
<script src="../js/jquery-1.12.2.min.js"></script>

<script>
    // $(function () {
    //     $.ajax({
    //         type:"get",
    //         url:"/hospital/doctor/selectAll.do",
    //         dataType:"json",
    //         success:function (data) {
    //             var optionString = "";
    //             var infos = data.info;
    //             for (var i = 0; i < infos.length; i++) {
    //                 optionString += "<option value=\"" + infos[i].id + "\" >" + infos[i].departName + "</option>";
    //             }
    //             $("#departId").html("<option value='请选择'>请选择...</option> "+optionString);
    //         },
    //         error: function (data) {
    //
    //         }
    //     })
    // })
    //
    // layui.use(["form", "layedit", "laydate","table","layer","jquery"], function(){
    //     var form = layui.form
    //         ,layer = layui.layer
    //         ,layedit = layui.layedit
    //         ,laydate = layui.laydate
    //         ,table = layui.table
    //         ,$ = layui.$;
    //
    //     //日期
    //     laydate.render({
    //         elem: '#date'
    //     });
    //
    //     //创建一个编辑器
    //     var editIndex = layedit.build('LAY_demo_editor');
    //
    //     $("#patientIdNumber").click(function () {
    //         var openPatient = layer.open({
    //             //layer提供了5种层类型。可传入的值有：0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）
    //             type: 1,
    //             title: "查找病人信息",
    //             area: ['1020px', '480px'],
    //             content: $("#selectInputPatient")//引用的弹出层的页面层的方式加载修改界面表单
    //         });
    //         //监听行单击事件（双击事件为：rowDouble）
    //         table.on('row(user)', function(obj){
    //             var data = obj.data;
    //             //动态向表传递赋值可以参看文章进行修改界面的更新前数据的显示，当然也是异步请求的要数据的修改数据的获取
    //             setFormValue(obj,data);
    //             layer.close(openPatient);
    //         });
    //
    //     })
    //
    //     $("#departId").val($('#selectId').val());
    //     form.render('select');
    //
    //     //方法级渲染
    //     table.render({
    //         elem: "#doctor"
    //         ,url: "/hospital/doctor/selectInHospital.do"
    //         ,method:"post"
    //         ,cols: [[
    //             {field:'id', title: '住院号', width:90}
    //             ,{field:'name', title: '姓名', width:90}
    //             ,{field:'idNumber',title:'身份证号',width:200}
    //             ,{field:'doctorId',title:'医生编号',width:90}
    //             ,{field:'doctorName',title:'医生姓名',width:90}
    //             ,{field:'departName', title: '科室', width:100}
    //             ,{field:'typeName', title: '病房类型', width:100}
    //             ,{field:'bedId', title: '床位号',width:90}
    //             ,{field:'statusName', title: '入院情况', width:100}
    //             ,{field:'enterTime', title: '入院时间', width:200}
    //         ]]
    //         ,id: 'testReload'
    //         ,page: true
    //     });
    //
    //     var $ = layui.$, active = {
    //         reload: function(){
    //             //执行重载
    //             table.reload('testReload', {
    //                 page: {
    //                     curr: 1 //重新从第 1 页开始
    //                 }
    //                 ,where: {
    //                     id:$("#id").val(),
    //                     departId: $("#departId").val(),
    //                     name:$("#name1").val(),
    //                     idNumber:$("#idNumber1").val()
    //                 }
    //             });
    //         }
    //     };
    //
    //     $('.demoTable .layui-btn').on('click', function(){
    //         var type = $(this).data('type');
    //         active[type] ? active[type].call(this) : '';
    //     });
    //
    //     //监听弹出框表单提交，massage是修改界面的表单数据'submit(demo11),是修改按钮的绑定
    //     function setFormValue(obj,data){
    //         var name = data.name;
    //         console.log(name);
    //         var idNumber = data.idNumber;
    //         console.log(idNumber);
    //         var doctorName = data.doctorName;
    //         var doctorId = data.doctorId;
    //         console.log(doctorId);
    //         $("#patientIdNumber").val(idNumber);
    //         $("#patientName").val(name);
    //         $("#doctorName").val(doctorName);
    //         $("#doctorId").val(doctorId);
    //     }
    //
    //
    //     //自定义验证规则
    //     form.verify({
    //         temperature: [
    //             /^(3\d|4[0-5])(\.\d)?$/
    //             ,'体温记录格式错误'
    //         ]
    //         ,heartRate: [
    //             /^\d{2,3}$/
    //             ,'心率记录格式错误'
    //         ]
    //         ,bloodPressure: [
    //             /^\d+\/\d+mmHg$/
    //             ,'血压记录格式错误'
    //         ]
    //         ,bloodSugar: [
    //             /^[0-9]+(.[0-9])$/
    //             ,'血糖记录格式错误'
    //         ]
    //         ,content: function(value){
    //             layedit.sync(editIndex);
    //         }
    //     });
    //
    //
    //     //监听提交
    //     form.on('submit(demo1)', function(data){
    //         $.ajax({
    //             type:"post",
    //             url:"/hospital/nurse/signRecord.do",
    //             data:$("form").serialize(),
    //             dataType: "json",
    //             success:function (msg) {
    //                 if (msg.code === 1){
    //                     alert("录入成功");
    //                 }
    //             },
    //             error:function () {
    //                 layer.msg("录入失败");
    //             }
    //         })
    //     });
    //

    //});

</script>

</body>
</html>